DEFINITION Triton;

IMPORT
  E := Exec,
  S := SYSTEM,
  U := Utility,
  W := Workbench,
  I := Intuition,
  GT := GadTools,
  G := Graphics,
  IE := InputEvent;

CONST
  tritonName = "triton.library";
  triton10Version = 1;
  triton11Version = 2;
  triton12Version = 3;
  triton13Version = 4;

TYPE
  MessagePtr = UNTRACED POINTER TO Message;
  AppPtr = UNTRACED POINTER TO App;
  DimensionsPtr = UNTRACED POINTER TO Dimensions;
  ProjectPtr = UNTRACED POINTER TO Project;
  DisplayObjectPtr = UNTRACED POINTER TO STRUCT 
  END;
  Message = STRUCT 
    project : ProjectPtr;
    id : E.ULONG;
    class : E.ULONG;
    data : E.ULONG;
    code : E.ULONG;
    qualifier : E.ULONG;
    seconds : E.ULONG;
    micros : E.ULONG;
    app : AppPtr;
  END;
  App = STRUCT 
    bitMask : E.LONGBITS;
    name : E.STRPTR;
    longName : E.STRPTR;
    info : E.STRPTR;
    version : E.STRPTR;
    release : E.STRPTR;
    date : E.STRPTR;
  END;
  Dimensions = STRUCT 
    left : E.UWORD;
    top : E.UWORD;
    width : E.UWORD;
    height : E.UWORD;
    left2 : E.UWORD;
    top2 : E.UWORD;
    width2 : E.UWORD;
    height2 : E.UWORD;
    zoomed : E.BOOL;
    reserved : ARRAY 3 OF E.UWORD;
  END;
  Project = STRUCT 
  END;

CONST
  msCloseWindow = 1;
  msError = 2;
  msNewValue = 3;
  msAction = 4;
  msIconDropped = 5;
  msKeyPressed = 6;
  msHelp = 7;
  msDiskInserted = 8;
  msDiskRemoved = 9;
  erOk = 0;
  erAllocMem = 1;
  erOpenWindow = 2;
  erWindowTooBig = 3;
  erDrawInfo = 4;
  erOpenFont = 5;
  erCreateMsgPort = 6;
  erInstallObject = 7;
  erCreateClass = 8;
  erNoLockPubScreen = 9;
  erInvalid = 10;
  erNoMem = 11;
  erOtherCreate = 12;
  erLayout = 13;
  erCreateContext = 14;
  omActivate = 23;
  wiTitle = (U.user + 1);
  wiFlags = (U.user + 2);
  wiUnderscore = (U.user + 3);
  wiPosition = (U.user + 4);
  wiCustomScreen = (U.user + 5);
  wiPubScreen = (U.user + 6);
  wiPubScreenName = (U.user + 7);
  wiPropFontAttr = (U.user + 8);
  wiFixedWidthFontAttr = (U.user + 9);
  wiBackfill = (U.user + 10);
  wiID = (U.user + 11);
  wiDimensions = (U.user + 12);
  wiScreenTitle = (U.user + 13);
  wiQuickHelp = (U.user + 14);
  mnTitle = (U.user + 101);
  mnItem = (U.user + 102);
  mnSub = (U.user + 103);
  mnFlags = (U.user + 104);
  atID = (U.user + 150);
  atFlags = (U.user + 151);
  atValue = (U.user + 152);
  atText = (U.user + 153);
  atDisabled = (U.user + 154);
  atBackfill = (U.user + 155);
  atMinWidth = (U.user + 156);
  atMinHeight = (U.user + 157);
  user = (U.user + 800);
  wfBackDrop = 000000001H;
  wfNoDragBar = 000000002H;
  wfNoDepthGadget = 000000004H;
  wfNoCloseGadget = 000000008H;
  wfNoActivate = 000000010H;
  wfNoEscClose = 000000020H;
  wfNoPScrFallback = 000000040H;
  wfNoZipGadget = 000000080H;
  wfZipCenterTop = 000000100H;
  wfNoMinTextWidth = 000000200H;
  wfNoSizeGadget = 000000400H;
  wfNoFontFallback = 000000800H;
  wfNoDelZip = 000001000H;
  wfSimpleRefresh = 000002000H;
  wfZipToCurrentPos = 000004000H;
  wfAppWindow = 000008000H;
  wfActivateStrGad = 000010000H;
  wfHelp = 000020000H;
  wfSystemAction = 000040000H;
  mfCheckIt = 000000001H;
  mfChecked = 000000002H;
  mfDisabled = 000000004H;
  wpDefault = 0;
  wpBelowTitlebar = 1;
  wpCenterTop = 1025;
  wpTopLeftScreen = 1026;
  wpCenterScreen = 1027;
  wpCenterDisplay = 1028;
  wpMousePointer = 1029;
  wpAboveCoords = 2049;
  wpBelowCoords = 2050;
  bfWindowBack = 0;
  bfRequesterBack = 1;
  bfNone = 2;
  bfShine = 3;
  bfShineShadow = 4;
  bfShineFill = 5;
  bfShineBackground = 6;
  bfShadow = 7;
  bfShadowFill = 8;
  bfShadowBackground = 9;
  bfFill = 10;
  bfFillBackground = 11;
  siUSButtonBack = 10002;
  siSButtonBack = 10003;
  ofRaised = 000000001H;
  ofHoriz = 000000002H;
  ofVert = 000000004H;
  ofRightAlign = 000000008H;
  txNoUnderscore = 000000100H;
  txHighlight = 000000200H;
  tx3D = 000000400H;
  txBold = 000000800H;
  txTitle = 000001000H;
  menuBarLabel = -1;
  caName = (U.user + 1);
  caLongName = (U.user + 2);
  caInfo = (U.user + 3);
  caVersion = (U.user + 4);
  caRelease = (U.user + 5);
  caDate = (U.user + 6);
  ezReqPos = (U.user + 1);
  ezLockProject = (U.user + 2);
  ezReturn = (U.user + 3);
  ezTitle = (U.user + 4);
  ezActivate = (U.user + 5);
  obDisplayObject = (tgOBJ + 3CH);
  doQuickHelpString = (tgOAT + 1E3H);
  obButton = (U.user + 305);
  obCheckBox = (U.user + 303);
  obCycle = (U.user + 310);
  obDropBox = (U.user + 312);
  obScroller = (U.user + 309);
  obFrameBox = (U.user + 306);
  grHoriz = (U.user + 201);
  grVert = (U.user + 202);
  grEnd = (U.user + 203);
  obLine = (U.user + 301);
  obPalette = (U.user + 307);
  obSlider = (U.user + 308);
  obSpace = (U.user + 901);
  obString = (U.user + 311);
  obText = (U.user + 304);
  obListview = (U.user + 313);
  obProgress = (U.user + 314);
  obImage = (tgOBJ + 3BH);
  buReturnOk = 000010000H;
  buEscOk = 000020000H;
  buShifted = 000040000H;
  buUnshifted = 000080000H;
  buYResize = 000100000H;
  btText = 0;
  btGetFile = 1;
  btGetDrawer = 2;
  btGetEntry = 3;
  grPropShare = 000000000H;
  grEqualShare = 000000001H;
  grPropSpaces = 000000002H;
  grArray = 000000004H;
  grAlign = 000000008H;
  grCenter = 000000010H;
  grFixHoriz = 000000020H;
  grFixVert = 000000040H;
  grIndep = 000000080H;
  scTotal = (U.user + 1504);
  scVisible = (U.user + 1505);
  slMin = (U.user + 1502);
  slMax = (U.user + 1503);
  stNone = 1;
  stSmall = 2;
  stNormal = 3;
  stBig = 4;
  lvTop = (U.user + 1506);
  lvReadOnly = 000010000H;
  lvSelect = 000020000H;
  lvShowSelected = 000040000H;
  lvNoCursorKeys = 000080000H;
  lvNoNumPadKeys = 000100000H;
  lvFWFont = 000200000H;
  lvNoGap = 000400000H;
  cyMX = 00010000H;
  cyRightLabels = 00020000H;
  fbGrouping = 00000001H;
  fbFraming = 00000002H;
  fbText = 00000004H;
  imBOOPSI = 00010000H;
  stInvisible = 10000H;
  stNoReturnBroadCast = 20000H;

VAR
  base : E.LibraryPtr;

PROCEDURE OpenProject(app: AppPtr; taglist: ARRAY OF U.TagItem): ProjectPtr;
PROCEDURE CloseProject(project: ProjectPtr);
PROCEDURE FirstOccurance(ch: E.UBYTE; str: E.STRPTR): E.LONG;
PROCEDURE NumOccurances(ch: E.UBYTE; str: E.STRPTR): E.LONG;
PROCEDURE GetErrorString(num: E.UWORD): E.STRPTR;
PROCEDURE CloseWindowSafely(win: I.WindowPtr);
PROCEDURE GetMsg(app: AppPtr): MessagePtr;
PROCEDURE ReplyMsg(msg: MessagePtr);
PROCEDURE Wait(app: AppPtr; otherbits: E.ULONG): E.ULONG;
PROCEDURE SetAttribute(prj: ProjectPtr; id: E.ULONG; attribute: E.ULONG; value: E.ULONG);
PROCEDURE GetAttribute(prj: ProjectPtr; id: E.ULONG; attribute: E.ULONG): E.ULONG;
PROCEDURE LockProject(prj: ProjectPtr);
PROCEDURE UnlockProject(prj: ProjectPtr);
PROCEDURE AutoRequest(app: AppPtr; lockproject: ProjectPtr; requestTRWindowTags: ARRAY OF U.TagItem): E.ULONG;
PROCEDURE EasyRequest(app: AppPtr; bodyfmt: E.STRPTR; gadfmt: E.STRPTR; taglist: ARRAY OF U.TagItem): E.ULONG;
PROCEDURE CreateApp(apptags: ARRAY OF U.TagItem): AppPtr;
PROCEDURE DeleteApp(app: AppPtr);
PROCEDURE GetLastError(app: AppPtr): E.UWORD;
PROCEDURE LockScreen(prj: ProjectPtr): I.ScreenPtr;
PROCEDURE UnlockScreen(scr: I.ScreenPtr);
PROCEDURE ObtainWindow(prj: ProjectPtr): I.WindowPtr;
PROCEDURE ReleaseWindow(win: I.WindowPtr);
PROCEDURE SendMessage(prj: ProjectPtr; id: E.ULONG; msgID: MessagePtr): E.ULONG;
PROCEDURE OpenProjectTags(app: AppPtr; tag..: U.Tag): ProjectPtr;
PROCEDURE AutoRequestTags(app: AppPtr; lockproject: ProjectPtr; tag..: U.Tag): E.ULONG;
PROCEDURE EasyRequestTags(app: AppPtr; bodyfmt: E.STRPTR; gadfmt: E.STRPTR; tag..: U.Tag): E.ULONG;
PROCEDURE CreateAppTags(apptags..: U.Tag): AppPtr;

END Triton.
